<!DOCTYPE html>
<!-- saved from url=(0037)http://127.0.0.1/wx/ybss/zhuce/zc.jsp -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

  <title>用户信息</title>

  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="format-detection" content="telephone=no, email=no">
  <!--[if IE]>
  <script src="http://127.0.0.1:80/wx/ybss/js/html5shiv.min.js"></script>
  <![endif]-->


  <script type="text/javascript" src="../script/constants.js"></script>
  <script src="resource/md5.js"></script>
  <script src="resource/jquery214.js"></script>
  <script src="resource/fastclick.js"></script>
  <script src="resource/jqueryweui.js"></script>
  </script><script src="resource/picker.js"></script>
  <script src="../script/api.js"></script>
  <script type="text/javascript" src="../script/aes.js"></script>
  <script type="text/javascript" charset="UTF-8" src="../script/naes.js"></script>
  <script type="text/javascript" src="../script/modeecb.js"></script>
  <script src="../script/tmd5.js"></script>
  <script>


  </script>

  <style>

   .odiv{
	   display:table;
	   background:#fff;
	   width:100%;
	   padding:5px;
	   border-top:1px solid #E1E1E1; 
	   border-bottom:1px solid #E1E1E1;
   }
   
   .outdiv{
	   display:table;
	   background:#fff;
	   width:100%;
	   padding-top:5px;
	   padding-bottom:5px;
	   border-top:1px solid #E1E1E1; 
	   border-bottom:1px solid #E1E1E1;
   }
   
   .idiv{
	   float: left;
	   font-size:15px;
	   margin-left: 10px;
	   height:32px;
	   line-height:32px;
   }
   .div_text{
	   float: right;
	   height:32px;
	   line-height:32px;
	   width:60%;
	   color: #8d8d8d;
	   font-size:15px;
	   text-align: right;
	   overflow:hidden;
	   white-space: nowrap; 
	   text-overflow: ellipsis;
	   margin-right:10px;
   }
   body {
    overflow-x:hidden;
    margin: 0;
   }
   html {
    overflow-x:hidden;
   }


  </style>

</head>

<body style="background:url(../image/bj.png) repeat-x 0;background-size:100%;">
<div style="height:550px;background:url(../image/mainbg.png) no-repeat right 0 bottom 0%;">
<div>
        <img id="banner1" src="../image/top.png" style="width: 100%;position:relative;">
 
		<div style="width:100%;display:table;background: #fff;" >			 
		<div id ="grxx" style="height:51px;line-height: 51px;text-align:center;width:100%;">
		个人信息
		</div>	
		</div>
		 <div style="height:20px"></div>
		    <div class='odiv' onclick="memberRight();">  
          <div class='idiv'>用户等级</div>
          <div class="div_text" id="dj" style="margin-right:20px">
          </div> 
          </div>
          <div style="height:20px"></div>
          <div class='odiv'>  
          <div class='idiv'>手机号</div>
          <!--<div style="float: right;height:32px;line-height:32px;height:100%">
            <img src='../image/timg.png' style="width:60%;vertical-align: middle;"/>
          </div>-->
          <div class="div_text" id="phone" style="margin-right:20px;">
          </div>
          </div>
          <div class='odiv'>  
          <div class='idiv'>公司</div>
          <div class="div_text" id="ypt_name" style="margin-right:20px;">
          </div> 
          </div>
          <div class='odiv' tapmode="presshover" onclick="addTaxcode();">  
          <div class='idiv'>绑定企业</div>
          <div style="float: right;height:32px;line-height:32px;height:100%;">
            <img src='../image/timg.png' style="width:50%;vertical-align: middle;"/>
          </div>
          <div class="div_text" id="taxcode">
          </div>
          </div>
          
          </div>
          

          <div style="height:20px"></div>
          
          <div class='odiv' tapmode="presshover" onclick="coupon();" style="display:none;">  
          <div class='idiv'>我的优惠券</div>
          <div style="float: right;height:32px;line-height:32px;">
            <img src='../image/timg.png' style="width:50%;vertical-align: middle;"/>
          </div>
          </div>
          
          <div class='odiv' tapmode="presshover" onclick="uiEdit();">  
          <div class='idiv'>个人设置</div>
          <div style="float: right;height:32px;line-height:32px;">
            <img src='../image/timg.png' style="width:50%;vertical-align: middle;"/>
          </div>
          </div>
          
          <!--<div id="addtaxcode" class='odiv' style="display:none" onclick="addTaxcode();">  
          <div class='idiv'>绑定企业</div>
          <div style="float: right;height:32px;line-height:32px;">
            <img src='../image/timg.png' style="width:50%;vertical-align: middle;"/>
          </div>
          </div>-->
          
          <div class='odiv' tapmode="presshover" onclick="tuiguang();">  
          <div class='idiv'>个人推广</div>
          <div style="float: right;height:32px;line-height:32px;">
            <img src='../image/timg.png' style="width:50%;vertical-align: middle;"/>
          </div>
          </div>
          
          <div class='odiv'>  
          <div class='idiv'>版本号</div>
          <div class="div_text" id="version" style="margin-right:20px;">
          </div> 
          </div>
          
          <div style="height:20px"></div>
          <div class='outdiv' tapmode="presshover" onclick="zhuxiao();">  
          <div style="width:100%;text-align: center;font-size:15px;height: 32px;line-height: 32px;">退出登录</div>
          </div>
</div>
			
</div>		

  <script>
  function coupon(){
     api.openWin({
	     name: 'coupon',
	     url: 'coupon.html'
     });
  }
  
  function addTaxcode(){
   var tcode = $("#taxcode").text();
   if(tcode == "暂无"){
     tcode = "";
   }
  api.openWin({
	     name: 'addtaxcode',
	     url: 'addtaxcode.html',
	     animation:{
			    type:"movein",                //动画类型（详见动画类型常量）
			    subType:"from_bottom",       //动画子类型（详见动画子类型常量）
			    duration:300                //动画过渡时间，默认300毫秒
			},
		 pageParam: {
				code: tcode
			}
     });
  }

  
  function uiEdit(){
     api.openWin({
	     name: 'userinfo_edit',
	     url: 'userinfo_edit.html'
     });
  }
  

  function tuiguang(){
  	api.openFrame({
                name: 'dialog',
                url: 'myewm.html',
                rect: {
                        x:0,
                        y:0,
                        w:api.winWidth,
                        h:api.winHeight
                },
                bgColor: 'rgba(0,0,0,0.6)',
                        bounces: false

        });
  }
  
  function memberRight(){
    api.openWin({
	    name: 'memberRight',
	    url: './hyxz.html'
    });
  }
  
  
 function zhuxiao(){
        var phone = $api.getStorage("dl_phone");
        var callback = function(ret, err){
            //console.log(JSON.stringify(ret));
            var flag = ret.flag;
        }
        var parameter = {"phone":phone};
        apiAjax(JSON.stringify(parameter),url.zxurl,callback);
		$api.rmStorage("loginid");
		$api.rmStorage("dl_phone");
		$api.rmStorage("de_num");
 		$api.rmStorage("openid");
 		$api.rmStorage("LOGIN_FLAG");
 		$api.rmStorage("payPwd");
 		$api.rmStorage("YHDJ");
 		$api.rmStorage("memberRight");
 		localStorage.setItem("ShoppingCart","");
	    $api.setStorage("shsk","N");
	    if($api.getStorage("chartPwd") == "true" || $api.getStorage("chartPwd") == true){
	       $api.setStorage("chartPwd","EXIT");
	    }
		$api.setStorage("lgtime","");
	    api.sendEvent({
	     name:'reloadIndex'
		});
		api.sendEvent({
	     name:'logout'
		});
		api.openWin({
	        name: 'login',
	        url: './login.html'
        });;
	}
  
  
	function back(){
		api.sendEvent({
	    name:'reloadIndex'
		});
   		 api.closeWin();
	}


	function showTip(){
		api.openWin({
	        name: '权限修改',
	        url: 'userinfo_edit.html'
        });
        api.closeWin();
	}

	apiready = function(){
	   api.parseTapmode();
	   api.addEventListener({
			name: 'reloadUserinfo'
		}, function(ret, err) {
			window.location.reload();
		});
	   var appVersion = api.appVersion;
	   $api.html($api.byId("version"), appVersion);
	   var uiId;
       var UILoading = api.require('UILoading');
		UILoading.flower({
		    center: {
		        x: api.winWidth/2.0,          
		        y: api.winHeight/2.0 
		    },
		    size: 30,
		    mask: "rgba(0,0,0,0.5)",
		    fixed: true
		}, function(ret) {
		    //alert(JSON.stringify(ret));
		    uiId = ret.id;
		});
	   api.addEventListener({
			name: 'reloadUinfo'
		}, function(ret, err) {
			window.location.reload();
		});
	var phone = $api.getStorage("dl_phone");
	var loginid = $api.getStorage("loginid");
	var content = {"id":loginid,"phone":phone};
    var callback = function(ret, err){
            //console.log(JSON.stringify(ret));
            if(ret){
            UILoading.closeFlower({
			    id: uiId
			});
            var aeskey = api.loadSecureValue({
				   sync: true,
				   key: 'aeskey'
			  });
        	    var str = ret.pds;
        	    str = Decrypt(str,aeskey);
        	    var data = eval('('+str+')');
        		$("#phone").text(data.PHONE);
        		if(typeof(data.TAXCODE) == "undefined" || data.TAXCODE == "undefined"){
	        		$("#taxcode").text("暂无");
	        		$("#ypt_name").text("暂未关联");      		
	        		$("#addtaxcode").show();
    		    }else{
	        		$("#taxcode").text(data.TAXCODE);
	        		var yhdj = $api.getStorage("YHDJ");
	        		if(yhdj == "undefined" || typeof(yhdj) == "undefined"){
	        		  yhdj = "平台会员";
	        		}
	        		dj(yhdj);
	        		$("#ypt_name").text(data.YPT_NAME);
    		    }
    		    if(data.ZFPWZT == '1'){
    		      $api.setStorage("payPwd",1);
    		    }else{
    		      $api.setStorage("payPwd",0);
    		    }
        	}else{
        	    UILoading.closeFlower({
				    id: uiId
				});
        		//api.alert({msg: JSON.stringify(err)});
        		zhuxiao();
        	}
        }
    encApiAjax(JSON.stringify(content),url.yhxx1,callback);
	}
	
	function dj(dj){
		
			if(taxcode!=""){
			
				$("#dj").text(dj);
				$("#grxx").text("个人信息("+dj+")");
			
			}else{
				$("#dj").text("普通客户");
				$("#grxx").text("个人信息(普通会员)");
			}
		
    		 
	}
</script>



</body></html>
